<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>methods选项:定义方法</title>
    <script src="../vue.js"></script>
</head>
<body>
<h2>【例3】methods选项:定义方法</h2>
<hr>
<div id="app">
    <button @click="打你()">请打我</button>
    <p>{{msg}}</p>
</div>
<script>
    let vm = new Vue({
        el: '#app',
        data: {
            msg: '原来好好的'
        },
        methods: {
            打你() {
                this.msg = '打你了，你哭吧。你能怎么样？'
            }
        }
    })
</script>
<hr>
<p><a href="index.html">返回</a>
    <script>document.write(document.lastModified); </script>
</P>
</body>
</html>
